package tcp5;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
	public static void main(String[] args) throws IOException,
			ClassNotFoundException {
		ServerSocket serverSocket = new ServerSocket(9999);
		Socket socket = serverSocket.accept();
		System.out.println("start");
		InputStream in = socket.getInputStream();
		ObjectInputStream oi = new ObjectInputStream(in);
		String str = (String) oi.readObject();
		System.out.println(str);

		ObjectOutputStream ou = new ObjectOutputStream(socket.getOutputStream());
		ou.writeObject("123123");
		ou.flush();

	}
}
